#!/usr/bin/env python
# encoding: utf-8
'''
@author: YanYeek
@file: base.py
@time: 2020/8/24 15:39
@desc:
'''
from django import forms


class BootStrapModelForm(forms.ModelForm):

	def __init__(self, *args, **kwargs):
		super(BootStrapModelForm, self).__init__(*args, **kwargs)
		# 统一给ModelForm生成的字段添加样式

		for name, field in self.fields.items():
			field.widget.attrs['class'] = 'form-control'
